# encoding: UTF-8
 
class Guide < ActiveRecord::Base

  belongs_to :levels

  attr_accessible :level_id, :status, :title, :content

  scope :open_status, where(:status => 0)

	def self.level_with(title)
		Level.find_by_title!(title).guides
		#Guide.find(:all, :select => "guides.*,levels.title", :joins=>"JOIN levels ON levels.id = guides.level_id", :order => "levels.title desc")
		#@data = ['1~9' => array('123','456'),'10~16' => array('abc','def')]
	end

end
